package dth.entity;

import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.*;

import dth.utils.DthUtil;
@Entity
@Table(name="movie")
public class Movie {
	@Id
	@Column(columnDefinition="int",name="movie_id")
	private int movieId;
	@Column(columnDefinition="varchar",name="movie_name")
	private String movieName;
	@Column(columnDefinition="double",name="movie_price")
	private double moviePrice;
//	@Column(columnDefinition="datetime",name="movie_time")
//	private Date movieTime;
	@Column(columnDefinition="int",name="fk_admin_id")
	private int fkAdminId;
	@Column(columnDefinition="datetime",name="date_insert")
	private Date dateInsert;
	@Column(columnDefinition="varchar",name="movie_image")
	private String image;
	@Column(columnDefinition="longtext",name="movie_description")
	private String description;
	@Transient
	private String priceStr;
	@OneToMany(mappedBy = "ownMovie")
	private List<BookMovie> bookMovies = new ArrayList<BookMovie>();
	
	public String getPriceStr() {
		return DthUtil.getFormatedNumber(moviePrice);
	}
	public void setPriceStr(String priceStr) {
		this.priceStr = priceStr;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getImage() {
		return image;
	}
	public void setImage(String image) {
		this.image = image;
	}
	public int getMovieId() {
		return movieId;
	}
	public void setMovieId(int movieId) {
		this.movieId = movieId;
	}
	public String getMovieName() {
		return movieName;
	}
	public void setMovieName(String movieName) {
		this.movieName = movieName;
	}
	public double getMoviePrice() {
		return moviePrice;
	}
	public void setMoviePrice(double moviePrice) {
		this.moviePrice = moviePrice;
	}
//	public Date getMovieTime() {
//		return movieTime;
//	}
//	public void setMovieTime(Date movieTime) {
//		this.movieTime = movieTime;
//	}
	public int getFkAdminId() {
		return fkAdminId;
	}
	public void setFkAdminId(int fkAdminId) {
		this.fkAdminId = fkAdminId;
	}
	public Date getDateInsert() {
		return dateInsert;
	}
	public void setDateInsert(Date dateInsert) {
		this.dateInsert = dateInsert;
	}
	
	
}
